package com.ay.weixin.fdc.boss.share.db;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import lizar.db.ibatis.Dao;

import com.ay.weixin.fdc.boss.share.domain.ShareRecord;

public class ShareRecordDao extends Dao {
	
	public void insert(ShareRecord share_record) throws SQLException{
		this.sqlMapper.insert("share_record.insert",share_record);
	}
	

	public void deleteBySaId(long sa_id) throws SQLException{
		this.sqlMapper.delete("share_activity_content.deleteBySaId",sa_id);
	}
	
	public boolean exists(long sa_id,String openid) throws SQLException{
		Map<String,Object> map=new HashMap<String,Object>();
		map.put("sa_id", sa_id);
		map.put("openid", openid);
		return this.sqlMapper.queryForObject("share_record.exists",map)!=null;
	}
	
}
